home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1997 February / macformat-047.iso / Demos / Simpsons Cartoon Studio™ Demo / Simpdata / simpmain / 00016_soundLoopRecordManager parent.ls < prev    next >
Encoding:
Text File  |  1996-09-06  |  2.3 KB  |  80 lines

  1. property ancestor
  2. global frameLimit, currentFrame, dirtyFlag
  3.  
  4. on birth me
  5.   set the ancestor of me to birth(script "recordMethods parent")
  6.   return me
  7. end
  8.  
  9. on record me
  10.   buildFilterList(me)
  11.   set countSoundLoopData to count(soundLoopData)
  12.   if countSoundLoopData < currentFrame then
  13.     set theSoundFrame to getLast(soundLoopData)
  14.     repeat with theFrameNumber = countSoundLoopData + 1 to currentFrame
  15.       append(soundLoopData, copyList(theSoundFrame))
  16.     end repeat
  17.   end if
  18.   set theSoundName to getAt(curClipRecord, 2)
  19.   set theSoundCastNum to getAt(curClipRecord, 3)
  20.   preLoadCast(theSoundCastNum)
  21.   set overFlow to 0
  22.   if currentFrame < frameLimit then
  23.     puppetSound(1, theSoundCastNum)
  24.     if currentFrame > count(scoreData) then
  25.       setAt(scoreData, currentFrame, copyList(autoHoldFrame))
  26.     end if
  27.     set theSoundFrame to list(theSoundName, theSoundCastNum)
  28.     setAt(soundLoopData, currentFrame, theSoundFrame)
  29.     setKrusty(playbackMgr)
  30.     showFrame(playbackMgr, currentFrame, -1000)
  31.     incrementFrame()
  32.   else
  33.     set overFlow to 1
  34.   end if
  35.   startTimer()
  36.   repeat while soundBusy(1) and (the timer < 180)
  37.     if currentFrame < frameLimit then
  38.       if currentFrame > count(scoreData) then
  39.         setAt(scoreData, currentFrame, copyList(autoHoldFrame))
  40.       end if
  41.       set theSoundFrame to list(theSoundName, theSoundCastNum)
  42.       setAt(soundLoopData, currentFrame, theSoundFrame)
  43.       setKrusty(playbackMgr)
  44.       showFrame(playbackMgr, currentFrame, -1000)
  45.       incrementFrame()
  46.       next repeat
  47.     end if
  48.     set overFlow to 1
  49.     exit repeat
  50.   end repeat
  51.   set oldVolume to the volume of sound 1
  52.   repeat while the volume of sound 1 > 0
  53.     startTimer()
  54.     set the volume of sound 1 to the volume of sound 1 - 8
  55.     repeat while the timer < 6
  56.     end repeat
  57.   end repeat
  58.   puppetSound(1, 0)
  59.   updateStage()
  60.   set the volume of sound 1 to oldVolume
  61.   if currentFrame < count(scoreData) then
  62.     repeat with theFrameNumber = currentFrame to count(scoreData)
  63.       set theSoundFrame to list(theSoundName, theSoundCastNum)
  64.       setAt(soundLoopData, theFrameNumber, theSoundFrame)
  65.     end repeat
  66.   end if
  67.   if overFlow then
  68.     showOverFlowDialog(me)
  69.   end if
  70.   extendClips(me)
  71.   if currentFrame > 1 then
  72.     decrementFrame()
  73.   end if
  74.   setKrusty(playbackMgr)
  75.   showFrame(playbackMgr, currentFrame, 0)
  76.   set dirtyFlag to 1
  77.   updateTheBrain(appMgr)
  78.   cursor(-1)
  79. end
  80.